package cn.itsource.base.service.impl;

import cn.itsource.base.mapper.BaseMapper;
import cn.itsource.base.query.BaseQuery;
import cn.itsource.base.service.IBaseService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


public class BaseServiceImpl<T> implements IBaseService<T> {
    @Autowired
    private BaseMapper<T> baseMapper;

    @Override
    public List<T> selectAll() {
        return baseMapper.selectAll();
    }

    @Override
    public void save(T t) {
        baseMapper.save(t);
    }

    @Override
    public void update(T t) {
        baseMapper.update(t);
    }

    @Override
    public void deleteById(Long id) {
        baseMapper.deleteById(id);
    }

    @Override
    public void batchDeleteByIds(List<Long> ids) {
        baseMapper.batchDeleteByIds(ids);
    }

    @Override
    public T selectById(Long id) {
        return baseMapper.selectById(id);
    }





    @Override
    public List<T> query(BaseQuery query) {
        return baseMapper.query(query);
    }

}
